﻿@model CellPhoneModel
@{
    ViewBag.Title = "Disable";
}

<h2>Disable</h2>

<p>The disable binding causes the associated DOM element to be disabled only when the parameter value is true. This is useful with form elements like input, select, and textarea.</p>
<p><a href="http://knockoutjs.com/documentation/disable-binding.html" target="_blank">http://knockoutjs.com/documentation/disable-binding.html</a></p>

@Html.VisiTogglerFromPartial(CodeSamplePartials.DISABLE_VIEW_MODEL, Html.CreateVisiToggler("show the samples view model C# source code ", htmlAttributes: new { @class = "onright" }, options: VisiOptions.HiddenByDefault))
<br />
@Html.VisiTogglerFromPartial(CodeSamplePartials.DISABLE_CONTROLLER, Html.CreateVisiToggler("show the samples controller C# source code ", htmlAttributes: new { @class = "onright" }, options: VisiOptions.HiddenByDefault))


<h3>Sample #1</h3>

<p>
    <input type="checkbox" @Html.KoAttrChecked(m => m.HasCellphone) id="cb1"/>
    <label for="cb1">I have a cellphone</label>
</p>
<p>
    Your cellphone number:
    <input type='text' @Html.KoAttrValue(m => m.CellphoneNumber).KoAttrDisable(m => !m.HasCellphone) />
</p>

@Html.VisiTogglerFromPartial(CodeSamplePartials.DISABLE1, Html.CreateVisiToggler("show the sample source code ", htmlAttributes: new { @class = "onright" }, options: VisiOptions.HiddenByDefault))

<p>&nbsp;</p>
<p>Next &gt; @Html.ActionLink("Custom Controls", "CustomControls", "Examples")</p>

@Model.ApplyBindingsScript(KoBindingOptions.IncludeData)